﻿
@{
    ViewBag.Title = "Index";
    Layout = null;
}

<style>
    .remark {
        color: #444;
        font-size: 12px;
    }

    .item {
        font-size: 12px;
        line-height: 28px;
        border-bottom: solid 1px #ccc;
        margin-bottom: 20px;
        padding: 10px;
        50px;
    }

    h2 {
        font-size: 16px;
    }

    table th {
        line-height: 28px;
        font-weight: bold;
        width: 120px;
        font-size: 12px;
        text-align: left;
    }

    table td {
        line-height: 28px;
        width: 120px;
        font-size: 12px;
    }
</style>
<fieldset>
    <legend>加密工具</legend>
    <div class="item">
        <h2>
            要加密的值
        </h2>
        <div>
            @using (Html.BeginForm("Encode", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {

                <div>
                    <input type="text" id="str" name="str" value="" />
                </div>
                <div>
                    <input type="button" value="submit" onclick="querystr()" />
                </div>
            }
            <div id="querystr">
            </div>
            <script>
                 function querystr() {
                     $.get("/home/Encode?time=" + new Date().getTime() + "&str=" + $("#str").val(), null, function (msg) {
                         $("#querystr").html(msg);
                     })
                 }
            </script>
        </div>
    </div>
</fieldset>

<h2>
    当前企业的access_token为：@ViewBag.access_token
</h2>
<iframe id="ajaxframe" name="ajaxframe" style="display: none"></iframe>
<fieldset>
    <legend>1、部门信息</legend>
    <div class="item">
        <h2>
            获取部门列表 
        </h2>
        <div>
            @using (Html.BeginForm("GetDepartmentList", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>部门ID</span>@Html.TextBox("getdepartmentList", "1")
                    </p>
                    <input type="button" value="点击获取部门信息" onclick="getOrganization()" />
                </div>
            }
            <div id="getOrganization">
            </div>
            <script>
                function getOrganization() {
                    $.get("/home/GetDepartmentList?time=" + new Date().getTime(), "id=" + $("#getdepartmentList").val(), function (msg) {
                        $("#getOrganization").html(msg);
                    })
                }
            </script>
        </div>
    </div>

    <div class="item">
        <h2>
            获取部门详情
        </h2>
        <div>
            @using (Html.BeginForm("GetDepartmentDetails", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>Department_ID</span>@Html.TextBox("id", "1")
                    </p>
                    <input type="button" value="获取部门详情" onclick="getDepartList()" />
                </div>
            }
            <div id="getDepartList">
            </div>
            <script>
                function getDepartList() {
                    $.get("/home/getdepartmentdetails?time=" + new Date().getTime(), "id=" + $("#id").val(), function (msg) {
                        $("#getDepartList").html(msg);
                    })
                }
            </script>
        </div>
    </div>

    <div class="item">
        <h2>
            创建部门
        </h2>
        <div>
            @using (Html.BeginForm("CreateDepartments", "home", FormMethod.Post, new { target = "ajaxframe",ID= "formCreateDepartments" }))
            {
                <div>
                    <p>
                        <span>Name</span>@Html.TextBox("name", "信息部")
                    </p>
                    <p>
                        <span>Parentid</span>@Html.TextBox("parentid", "1")
                    </p>
                    <input type="button" value="创建部门" onclick="getCreateDepart()" />
                </div>
            }
            <div id="getCreateDepar111t">
            </div>
            <script>
                function getCreateDepart() {
       
                    $.post("/home/CreateDepartments?time=" + new Date().getTime(), $("#formCreateDepartments").serializeArray(), function (msg) {
                       // alert(msg);
                        $("#getCreateDepar111t").html(msg);
                    })
                }
            </script>
        </div>
    </div>

    <div class="item">
        <h2>
            更新部门
        </h2>
        <div>
            @using (Html.BeginForm("UpdateDepartments", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>ID</span>@Html.TextBox("id", 54593671)
                    </p>
                    <p>
                        <span>Name</span>@Html.TextBox("name", "信息二部")
                    </p>

                    <input type="submit" value="更新部门" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            删除部门
        </h2>
        <div>
            @using (Html.BeginForm("DeleteDepartments", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>ID</span>@Html.TextBox("id", 54593671)
                    </p>
                    <input type="submit" value="删除部门" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            查询部门的所有上级父部门路径
        </h2>
        <div>
            @using (Html.BeginForm("QueryAllParentDepartment", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>ID</span>@Html.TextBox("id", 18296475)
                    </p>
                    <input type="button" value="查询部门的所有上级父部门路径" onclick="getQueryAllParentDepartment()" />
                </div>
            }
            <div id="getQueryAllParentDepartments">
            </div>
            <script>
                function getQueryAllParentDepartment() {
                    $.get("/home/QueryAllParentDepartment?time=" + new Date().getTime(), "id=" + $("#id").val(), function (msg) {
                        $("#getQueryAllParentDepartments").html(msg);
                    })
                }
            </script>
        </div>
    </div>

    <div class="item">
        <h2>
            查询指定用户的所有上级父部门路径
        </h2>
        <div>
            @using (Html.BeginForm("QueryAppointParentDepartment", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>userId</span>@Html.TextBox("UserID", "manager5443")
                    </p>
                    <input type="button" value="查询部门的所有上级父部门路径" onclick="getQueryAppointParentDepartment()" />
                </div>
            }
            <div id="getQueryAppointParentDepartments">
            </div>
            <script>
                function getQueryAppointParentDepartment() {
                    $.get("/home/QueryAppointParentDepartment?time=" + new Date().getTime(), "userid=" + $("#UserID").val(), function (msg) {
                        $("#getQueryAppointParentDepartments").html(msg);
                    })
                }
            </script>
        </div>
    </div>

</fieldset>
<fieldset>
    <legend>2、人员管理</legend>
    <div class="item">
        <h2>
            获取成员详情
        </h2>
        <div>
            @using (Html.BeginForm("getMember", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {

                <div>
                    <p>
                        <span>userId</span>@Html.TextBox("userid", "manager5443")
                    </p>
                    <input type="button" value="获取人员信息" onclick="getMember()" />
                </div>
            }
            <div id="getMember">
            </div>
            <script>
                function getMember() {
                    $.get("/home/getuserInfo?time=" + new Date().getTime(), "userid=" + $("#userid").val(), function (msg) {
                        $("#getMember").html(msg);
                    })
                }
            </script>
        </div>
    </div>
    <div class="item">
        <h2>
            创建单个成员
        </h2>
        <div>
            @using (Html.BeginForm("CreateUser", "home", FormMethod.Post, new { target = "ajaxframe" , ID = "fromCreateUser" }))
            {
                <div>
                    <p>
                        <span>Name</span>@Html.TextBox("name", "张三")
                    </p>
                    <p>
                        <span>Department</span>@Html.TextBox("department", 1)
                    </p>
                    <p>
                        <span>Mobile</span>@Html.TextBox("mobile", "18088126711")
                    </p>
                    <input type="button" value="创建人员" onclick="getCreateUser()" />
                </div>
            }
            <div id="getCreateUsers">
            </div>
            <script>
                function getCreateUser() {

                    $.post("/home/CreateUser?time=" + new Date().getTime(), $("#fromCreateUser").serializeArray(), function (msg) {
                       // alert(msg);
                        $("#getCreateUsers").html(msg);
                    })
                }
            </script>
        </div>
    </div>
    <div class="item">
        <h2>
            更新成员
        </h2>
        <div>
            @using (Html.BeginForm("UpdateUser", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>Userid</span>@Html.TextBox("userid", "1469242852774889")
                    </p>
                    <p>
                        <span>Name</span>@Html.TextBox("name", "向荣小号")
                    </p>
                    <input type="submit" value="更新人员" />
                </div>
            }
        </div>
    </div>
    <div class="item">
        <h2>
            删除成员
        </h2>
        <div>
            @using (Html.BeginForm("DeleteUser", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>Userid</span>@Html.TextBox("userid", "1469242852774889")
                    </p>
                    <input type="submit" value="删除人员" />
                </div>
            }
        </div>
    </div>
    <div class="item">
        <h2>
            批量删除成员
        </h2>
        <div>
            @using (Html.BeginForm("DeleteAllUser", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>UserList</span>@Html.TextBox("useridlist", "1469302452-729027995")
                    </p>
                    <p>
                        <span>UserList1</span>@Html.TextBox("useridlist", "1356135102-732930616")
                    </p>
                    <input type="submit" value="批量删除人员" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            获取部门成员
        </h2>
        <div>
            @using (Html.BeginForm("GetDepartmentMember", "home", FormMethod.Post, new { target = "ajaxframe", ID = "fromGetDepartmentMember" }))
            {
                <div>
                    <p>
                        <span>Department_ID</span>@Html.TextBox("department_id", "18296474")
                    </p>
                    <input type="button" value="获取部门成员" onclick="getDepartmentMember()" />
                </div>
            }
            <div id="getDepartmentMembers">
            </div>
            <script>
                function getDepartmentMember() {
                    $.post("/home/GetDepartmentMember?time=" + new Date().getTime(), $("#fromGetDepartmentMember").serializeArray(), function (msg) {
                        $("#getDepartmentMembers").html(msg);
                    })
                }
            </script>
        </div>
    </div>

    <div class="item">
        <h2>
            获取部门成员详情
        </h2>
        <div>
            @using (Html.BeginForm("GetDepartmentMemberList", "home", FormMethod.Post, new { target = "ajaxframe", ID = "fromgetDepartmentMemberLists" }))
            {
                <div>
                    <p>
                        <span>Department_ID</span>@Html.TextBox("department_id", "18296474")
                    </p>
                    <input type="button" value="获取部门成员详情" onclick="getDepartmentMemberList()" />
                </div>
            }
            <div id="getDepartmentMemberLists">
            </div>
            <script>
                function getDepartmentMemberList() {
                    $.post("/home/Getdepartmentmemberlist?time=" + new Date().getTime(), $("#fromgetDepartmentMemberLists").serializeArray(), function (msg) {
                        $("#getDepartmentMemberLists").html(msg);
                    })
                }
            </script>
        </div>
    </div>

    <div class="item">
        <h2>
            获取管理员列表
        </h2>
        <div>
            @using (Html.BeginForm("GetAdministratorList", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <input type="button" value="获取管理员列表" onclick="getAdministratorList()"/>
                </div>
            }
            <div id="getAdministratorLists">
            </div>
            <script>
                function getAdministratorList() {
                    $.post("/home/GetAdministratorList?time=" + new Date().getTime(), function (msg) {
                        $("#getAdministratorLists").html(msg);
                    })
                }
            </script>
        </div>
    </div>

    <div class="item">
        <h2>
            根据unionid获取成员的userid
        </h2>
        <div>
            @using (Html.BeginForm("GetUseridByUnionid", "home", FormMethod.Post, new { target = "ajaxframe", ID = "fromgetUseridByUnionid" }))
            {
                <div>
                    <p>
                        <span>unionid</span>@Html.TextBox("unionid", "PO8PuiPu7kiS2qU7azTLEY9AiEiE")
                    </p>
                    <input type="button" value="获取成员的userid" onclick="getUseridByUnionid()" />
                </div>
            }
            <div id="getUseridByUnionids">
            </div>
            <script>
                function getUseridByUnionid() {
                    $.post("/home/GetUseridByUnionid?time=" + new Date().getTime(), $("#fromgetUseridByUnionid").serializeArray(), function (msg) {
                        $("#getUseridByUnionids").html(msg);
                    })
                }
            </script>
        </div>
    </div>
    <div class="item">
        <h2>
            获取企业员工人数
        </h2>
        <div>
            @using (Html.BeginForm("GetUserNumber", "home", FormMethod.Post, new { target = "ajaxframe", ID = "fromgetUserNumber" }))
            {
                <div>
                    <p>
                        <span>OnlyActive</span>@Html.TextBox("onlyActive", 1)
                    </p>
                    <input type="button" value="获取企业员工人数" onclick="getUserNumber()" />
                </div>
            }
            <div id="getUserNumbers">
            </div>
            <script>
                function getUserNumber() {
                    $.post("/home/GetUserNumber?time=" + new Date().getTime(), $("#fromgetUserNumber").serializeArray(), function (msg) {
                        $("#getUserNumbers").html(msg);
                    })
                }
            </script>
        </div>
    </div>


</fieldset>

<fieldset>
    <legend>3、权限管理</legend>
    <div class="item">
        <h2>
            获取通讯录权限
        </h2>
        <div>
            @using (Html.BeginForm("GetAddressJurisdiction", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <input type="submit" value="获取通讯录权限" />
                </div>
            }
        </div>
    </div>
</fieldset>

<fieldset>
    <legend>3、消息会话管理</legend>
    <div class="item">
        <h2>
            创建会话
        </h2>
        <div>
            @using (Html.BeginForm("CreateConversation", "home", FormMethod.Post, new { target = "ajaxframe", ID = "fromCreateConversation" }))
            {
                <div>
                    <p>
                        <span>Name</span>@Html.TextBox("name", "小号二群")
                    </p>
                    <p>
                        <span>Owner</span>@Html.TextBox("owner", "manager5443")
                    </p>
                    <p>
                        <span>Useridlist</span>@Html.TextBox("useridlist", "manager5443")
                    </p>
                    <p>
                        <span>Useridlist1</span>@Html.TextBox("useridlist", "06141601305197")
                    </p>
                    <p>
                        <span>Useridlist2</span>@Html.TextBox("useridlist", "1061626355840717")
                    </p>
                    <input type="button" value="创建会话"  onclick="getCreateConversation()"/>
                </div>
            }
            <div id="getCreateConversations">
            </div>
            <script>
                function getCreateConversation() {
                    $.post("/home/CreateConversation?time=" + new Date().getTime(), $("#fromCreateConversation").serializeArray(), function (msg) {
                        $("#getCreateConversations").html(msg);
                    })
                }
            </script>
        </div>
    </div>

    <div class="item">
        <h2>
            修改会话
        </h2>
        <div>
            @using (Html.BeginForm("ModifyConversation", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>Name</span>@Html.TextBox("chatid", "chat8b69bbac9345edbc1858066bf6641db0")
                    </p>
                    <p>
                        <span>Owner</span>@Html.TextBox("name", "向荣小号讨论大群")
                    </p>
                    <input type="submit" value="修改会话" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            获取会话
        </h2>
        <div>
            @using (Html.BeginForm("ObtainConversation", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>Chatid</span>@Html.TextBox("chatid", "chat8b69bbac9345edbc1858066bf6641db0")
                    </p>
                    <input type="button" value="获取会话" onclick="getObtainConversation()" />
                </div>
            }
            <div id="getObtainConversations">
            </div>
            <script>
                function getObtainConversation() {
                    $.post("/home/ObtainConversation?time=" + new Date().getTime(), $("#chatid").serializeArray(), function (msg) {
                        $("#getObtainConversations").html(msg);
                    })
                }
            </script>
        </div>
    </div>

    <div class="item">
        <h2>
            卡片消息无Action样式
        </h2>
        <div>
            @using (Html.BeginForm("NoAction", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>Chatid</span>@Html.TextBox("chatid", "chat8b69bbac9345edbc1858066bf6641db0")
                    </p>
                    <p>
                        <span>Msgtype</span>@Html.TextBox("msgtype", "action_card")
                    </p>
                    <p>
                        <span>Title</span>@Html.TextBox("action_card.title", "小号登录")
                    </p>
                    <p>
                        <span>Markdown</span>@Html.TextBox("action_card.markdown", "一号小号登录")
                    </p>
                    <input type="submit" value="卡片消息无Action样式" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            卡片消息单一Action样式
        </h2>
        <div>
            @using (Html.BeginForm("OneAction", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>Chatid</span>@Html.TextBox("chatid", "chat8b69bbac9345edbc1858066bf6641db0")
                    </p>
                    <p>
                        <span>Msgtype</span>@Html.TextBox("msgtype", "action_card")
                    </p>
                    <p>
                        <span>Title</span>@Html.TextBox("action_card.title", "小号登录")
                    </p>
                    <p>
                        <span>Markdown</span>@Html.TextBox("action_card.markdown", "二号小号登录")
                    </p>
                    <p>
                        <span>Markdown</span>@Html.TextBox("action_card.single_title", "查看详情")
                    </p>
                    <p>
                        <span>Markdown</span>@Html.TextBox("action_card.single_url", "https://open.dingtalk.com")
                    </p>
                    <p>
                        <span>Markdown</span>@Html.TextBox("agentid.markdown", "xx")
                    </p>
                    <input type="submit" value="卡片消息单一Action样式" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            卡片消息多Action样式
        </h2>
        <div>
            @using (Html.BeginForm("ManyAction", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>Chatid</span>@Html.TextBox("chatid", "chat8b69bbac9345edbc1858066bf6641db0")
                    </p>
                    <p>
                        <span>Msgtype</span>@Html.TextBox("msgtype", "action_card")
                    </p>
                    <p>
                        <span>Title</span>@Html.TextBox("action_card.title", "小号登录")
                    </p>
                    <p>
                        <span>markdown</span>@Html.TextBox("action_card.markdown", "xxx")
                    </p>
                    <p>
                        <span>btn_orientation</span>@Html.TextBox("action_card.btn_orientation", "1")
                    </p>
                    <p>
                        <span>Title</span>@Html.TextBox("action_card.btn_json_list", "按钮一")
                    </p>
                    <p>
                        <span>Action_url</span>@Html.TextBox("action_card.btn_json_list", "https://www.tmall.com")
                    </p>
                    @*<p>
                        <span>Agentid</span>@Html.TextBox("action_card.agentid", "xx")
                    </p>*@
                    <input type="submit" value="卡片消息多Action样式" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            发送text消息
        </h2>
        <div>
            @using (Html.BeginForm("TextMessage", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>Chatid</span>@Html.TextBox("chatid", "chat8b69bbac9345edbc1858066bf6641db0")
                    </p>
                    <p>
                        <span>Msgtype</span>@Html.TextBox("msgtype", "text")
                    </p>
                    <p>
                        <span>markdown</span>@Html.TextBox("text.content", "四号小号登录")
                    </p>
                    <input type="submit" value="发送text消息" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            发送image消息
        </h2>
        <div>
            @using (Html.BeginForm("ImgMessage", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>Chatid</span>@Html.TextBox("chatid", "chat8b69bbac9345edbc1858066bf6641db0")
                    </p>
                    <p>
                        <span>Msgtype</span>@Html.TextBox("msgtype", "image")
                    </p>
                    <p>
                        <span>markdown</span>@Html.TextBox("image.media_id", "MEDIA_ID")
                    </p>
                    <input type="submit" value="发送image消息" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            发送voice消息
        </h2>
        <div>
            @using (Html.BeginForm("VoiceMessage", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>Chatid</span>@Html.TextBox("chatid", "chat8b69bbac9345edbc1858066bf6641db0")
                    </p>
                    <p>
                        <span>Msgtype</span>@Html.TextBox("msgtype", "voice")
                    </p>
                    <p>
                        <span>markdown</span>@Html.TextBox("voice.media_id", "MEDIA_ID")
                    </p>
                    <p>
                        <span>markdown</span>@Html.TextBox("voice.duration", "5")
                    </p>
                    <input type="submit" value="发送voice消息" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            发送file消息
        </h2>
        <div>
            @using (Html.BeginForm("FileMessage", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>Chatid</span>@Html.TextBox("chatid", "chat8b69bbac9345edbc1858066bf6641db0")
                    </p>
                    <p>
                        <span>Msgtype</span>@Html.TextBox("msgtype", "file")
                    </p>
                    <p>
                        <span>markdown</span>@Html.TextBox("file.media_id", "MEDIA_ID")
                    </p>
                    <input type="submit" value="发送file消息" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            发送link消息
        </h2>
        <div>
            @using (Html.BeginForm("LinkMessage", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>Chatid</span>@Html.TextBox("chatid", "chat8b69bbac9345edbc1858066bf6641db0")
                    </p>
                    <p>
                        <span>Msgtype</span>@Html.TextBox("msgtype", "link")
                    </p>
                    <p>
                        <span>markdown</span>@Html.TextBox("link.title", "测试")
                    </p>
                    <p>
                        <span>markdown</span>@Html.TextBox("link.text", "测试")
                    </p>
                    <p>
                        <span>markdown</span>@Html.TextBox("link.picUrl", "https://gw.alicdn.com/tps/TB1FN16LFXXXXXJXpXXXXXXXXXX-256-130.png")
                    </p>
                    <p>
                        <span>markdown</span>@Html.TextBox("link.messageUrl", "http://www.dingtalk.com")
                    </p>
                    <input type="submit" value="发送link消息" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            发送OA消息
        </h2>
        <div>
            @using (Html.BeginForm("OaMessage", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>Chatid</span>@Html.TextBox("chatid", "chat8b69bbac9345edbc1858066bf6641db0")
                    </p>
                    <p>
                        <span>Msgtype</span>@Html.TextBox("msgtype", "oa")
                    </p>
                    <p>
                        <span>markdown</span>@Html.TextBox("oa.message_url", "https://www.dingtalk.com")
                    </p>
                    <p>
                        <span>markdown</span>@Html.TextBox("oa.pc_message_url", "https://oa.dingtalk.com")
                    </p>
                    <p>
                        <span>markdown</span>@Html.TextBox("oa.head.bgcolor", "FFBBBBBB")
                    </p>
                    <p>
                        <span>markdown</span>@Html.TextBox("oa.head.text", "头部标题")
                    </p>
                    <p>
                        <span>markdown</span>@Html.TextBox("oa.body.title", "正文标题")
                    </p>
                    <p>
                        <span>markdown</span>@Html.TextBox("oa.body.form[0].key", "姓名")
                    </p>
                    <p>
                        <span>markdown</span>@Html.TextBox("oa.body.form[0].value", "张三")
                    </p>
                    <p>
                        <span>markdown</span>@Html.TextBox("oa.body.content", "大段文本大段文本大段文本大段文本大段文本大段文本大段文本大段文本大段文本大段文本大段文本大段文本")
                    </p>
                    <input type="submit" value="发送link消息" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            发送markdown消息
        </h2>
        <div>
            @using (Html.BeginForm("MarkDownMessage", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>Chatid</span>@Html.TextBox("chatid", "chat8b69bbac9345edbc1858066bf6641db0")
                    </p>
                    <p>
                        <span>Msgtype</span>@Html.TextBox("msgtype", "markdown")
                    </p>
                    <p>
                        <span>markdown.title</span>@Html.TextBox("markdown.title", "首屏会话透出的展示内容")
                    </p>
                    <p>
                        <span>markdown.text</span>@Html.TextBox("markdown.text", "# 这是支持markdown的文本 \n## 标题2  \n* 列表1 \n![alt 啊](https://img.alicdn.com/tps/TB1XLjqNVXXXXc4XVXXXXXXXXXX-170-64.png)")
                    </p>
                    <input type="submit" value="发送markdown消息" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            发送普通消息
        </h2>
        <div>
            @using (Html.BeginForm("SendConversationMessage", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>Sender</span>@Html.TextBox("sender", "manager5443")
                    </p>
                    <p>
                        <span>Cid</span>@Html.TextBox("cid", "chat8b69bbac9345edbc1858066bf6641db0")
                    </p>
                    <p>
                        <span>Msgtype</span>@Html.TextBox("msgtype", "text")
                    </p>
                    <p>
                        <span>text.content</span>@Html.TextBox("text.content", "首屏会话透出的展示内容")
                    </p>
                    <input type="submit" value="发送普通消息" />
                </div>
            }
        </div>
    </div>


</fieldset>

<fieldset>
    <legend>4、智能办公管理</legend>
    <div class="item">
        <h2>
            考勤管理
            考勤打卡记录开放
        </h2>
        <div>
            @using (Html.BeginForm("AttendanceCardRecord", "home", FormMethod.Post, new { target = "ajaxframe", ID = "fromAttendanceCardRecord" }))
            {
                <div>
                    <p>
                        <span>UserIds</span>@Html.TextBox("userIds[0]", "1061626355840717")
                    </p>
                    <p>
                        <span>CheckDateFrom</span>@Html.TextBox("checkDateFrom", "2017-11-15 08:00:00")
                    </p>
                    <p>
                        <span>CheckDateTo</span>@Html.TextBox("checkDateTo", "2017-11-17 18:00:00")
                    </p>
                    <input type="button" value="考勤打卡记录开放" onclick="getAttendanceCardRecord()" />
                </div>
            }
            <div id="getAttendanceCardRecords">
            </div>
            <script>
                function getAttendanceCardRecord() {
                    $.post("/home/Attendancecardrecord?time=" + new Date().getTime(), $("#fromAttendanceCardRecord").serializeArray(), function (msg) {
                        $("#getAttendanceCardRecords").html(msg);
                    })
                }
            </script>
        </div>
    </div>

    <div class="item">
        <h2>
            签到
        </h2>
        <div>
            @using (Html.BeginForm("SignList", "home", FormMethod.Post, new { target = "ajaxframe", ID = "fromSignList" }))
            {
                <div>
                    <p>
                        <span>Department_id</span>@Html.TextBox("department_id", "1")
                    </p>
                    <p>
                        <span>Start_time</span>@Html.TextBox("start_time", 564554)
                    </p>
                    <p>
                        <span>End_time</span>@Html.TextBox("end_time", 1458454)
                    </p>
                    <p>
                        <span>Offset</span>@Html.TextBox("offset", 0)
                    </p>
                    <p>
                        <span>Size</span>@Html.TextBox("size", 1)
                    </p>
                    <p>
                        <span>Order</span>@Html.TextBox("order", "asc")
                    </p>
                    <input type="button" value="签到" onclick="getSignList()" />
                </div>
            }
            <div id="getSignLists">
            </div>
            <script>
                function getSignList() {
                    $.post("/home/SignList?time=" + new Date().getTime(), $("#fromSignList").serializeArray(), function (msg) {
                        $("#getSignLists").html(msg);
                    })
                }
            </script>
        </div>
    </div>

</fieldset>

<fieldset>
    <legend>5、文件管理</legend>
    <div class="item">
        <h2>
            管理多媒体文件
            上传媒体文件
        </h2>
        <div>
            @using (Html.BeginForm("UploadFiles", "home", FormMethod.Post, new { target = "ajaxframe", ID = "fromgetUploadFiles" }))
            {
                <div>
                    <p>
                        <span>fileWithPath</span>@Html.TextBox("fileWithPath", @"D:\cx1.jpg")
                    </p>
                    <p>
                        <span>type</span>@Html.TextBox("type", "image")
                    </p>
                    <input type="button" value="上传文件" onclick="getUploadFiles()" />
                </div>
            }
            <div id="getUploadFiless">
            </div>
            <script>
                function getUploadFiles() {
                    $.post("/home/Uploadfiles?time=" + new Date().getTime(), $("#fromgetUploadFiles").serializeArray(), function (msg) {
                        $("#getUploadFiless").html(msg);
                    })
                }
            </script>
        </div>
    </div>
</fieldset>

<fieldset>
    <legend>6、钉盘接口</legend>
    <div class="item">
        <h2>
            发送文件给指定用户
        </h2>
        <div>
            @using (Html.BeginForm("SendFiles", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>agent_id</span>@Html.TextBox("agent_id", "135718068")
                    </p>
                    <p>
                        <span>userid</span>@Html.TextBox("userid", "manager5443")
                    </p>
                    <p>
                        <span>media_id</span>@Html.TextBox("media_id", "@lADPBY0V4sFt3jPMr8yv")
                    </p>
                    <p>
                        <span>file_name</span>@Html.TextBox("file_name", "lADOh27rocyvzK8_175_175")
                    </p>
                    <input type="submit" value="发送文件给指定用户" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            新增文件到用户钉盘
        </h2>
        <div>
            @using (Html.BeginForm("AdduserFiles", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>agent_id</span>@Html.TextBox("agent_id", "@lAjPBY0V4ra5OWPOKfttl85zMMrU")
                    </p>
                    <p>
                        <span>code</span>@Html.TextBox("code", "@lAjPBY0V4ra5OWPOKfttl85zMMrU")
                    </p>
                    <p>
                        <span>media_id</span>@Html.TextBox("media_id", "@lAjPBY0V4ra5OWPOKfttl85zMMrU")
                    </p>
                    <p>
                        <span>space_id</span>@Html.TextBox("space_id", "@lAjPBY0V4ra5OWPOKfttl85zMMrU")
                    </p>
                    <p>
                        <span>folder_id</span>@Html.TextBox("folder_id", "@lAjPBY0V4ra5OWPOKfttl85zMMrU")
                    </p>
                    <p>
                        <span>name</span>@Html.TextBox("name", "@lAjPBY0V4ra5OWPOKfttl85zMMrU")
                    </p>
                    <p>
                        <span>overwrite</span>@Html.TextBox("overwrite", "@lAjPBY0V4ra5OWPOKfttl85zMMrU")
                    </p>
                    <input type="submit" value="新增文件到用户钉盘" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            获取企业下的自定义空间
        </h2>
        <div>
            @using (Html.BeginForm("GetenterPriseSpace", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>domain</span>@Html.TextBox("domain", "@lAjPBY0V4ra5OWPOKfttl85zMMrU")
                    </p>
                    <p>
                        <span>agent_id</span>@Html.TextBox("agent_id", "@lAjPBY0V4ra5OWPOKfttl85zMMrU")
                    </p>
                    <input type="submit" value="获取企业下的自定义空间" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            授权用户访问企业下的自定义空间
        </h2>
        <div>
            @using (Html.BeginForm("GetenterPriseSpace", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>agent_id</span>@Html.TextBox("agent_id", "@lAjPBY0V4ra5OWPOKfttl85zMMrU")
                    </p>
                    <p>
                        <span>domain</span>@Html.TextBox("domain", "@lAjPBY0V4ra5OWPOKfttl85zMMrU")
                    </p>
                    <p>
                        <span>type</span>@Html.TextBox("type", "@lAjPBY0V4ra5OWPOKfttl85zMMrU")
                    </p>
                    <p>
                        <span>userid</span>@Html.TextBox("userid", "@lAjPBY0V4ra5OWPOKfttl85zMMrU")
                    </p>
                    <p>
                        <span>path</span>@Html.TextBox("path", "@lAjPBY0V4ra5OWPOKfttl85zMMrU")
                    </p>
                    <p>
                        <span>fileids</span>@Html.TextBox("fileids", "@lAjPBY0V4ra5OWPOKfttl85zMMrU")
                    </p>
                    <p>
                        <span>duration</span>@Html.TextBox("duration", 123)
                    </p>
                    <input type="submit" value="授权用户访问企业下的自定义空间" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            开启文件上传事务
        </h2>
        <div>
            @using (Html.BeginForm("OpenFileUpload", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>agent_id</span>@Html.TextBox("agent_id", "@lAjPBY0V4ra5OWPOKfttl85zMMrU")
                    </p>
                    <p>
                        <span>file_size</span>@Html.TextBox("file_size", 12)
                    </p>
                    <p>
                        <span>chunk_numbers</span>@Html.TextBox("chunk_numbers", 1)
                    </p>
                    <input type="submit" value="开启文件上传事务" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            上传文件块
        </h2>
        <div>
            @using (Html.BeginForm("UploadFileFast", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>agent_id</span>@Html.TextBox("agent_id", "@lAjPBY0V4ra5OWPOKfttl85zMMrU")
                    </p>
                    <p>
                        <span>upload_id</span>@Html.TextBox("upload_id", "")
                    </p>
                    <p>
                        <span>chunk_sequence</span>@Html.TextBox("chunk_sequence", 1)
                    </p>
                    <input type="submit" value="上传文件块" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            提交文件上传事务
        </h2>
        <div>
            @using (Html.BeginForm("ExtractingFileUpload", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>agent_id</span>@Html.TextBox("agent_id", "@lAjPBY0V4ra5OWPOKfttl85zMMrU")
                    </p>
                    <p>
                        <span>file_size</span>@Html.TextBox("file_size", 12)
                    </p>
                    <p>
                        <span>chunk_numbers</span>@Html.TextBox("chunk_numbers", 1)
                    </p>
                    <p>
                        <span>upload_id</span>@Html.TextBox("upload_id", "123")
                    </p>
                    <input type="submit" value="提交文件上传事务" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            单步文件上传
        </h2>
        <div>
            @using (Html.BeginForm("SingleFileUpload", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>agent_id</span>@Html.TextBox("agent_id", "@lAjPBY0V4ra5OWPOKfttl85zMMrU")
                    </p>
                    <p>
                        <span>file_size</span>@Html.TextBox("file_size", 12)
                    </p>
                    <input type="submit" value="单步文件上传" />
                </div>
            }
        </div>
    </div>

</fieldset>

<fieldset>
    <legend>7、微应用管理</legend>
    <div class="item">
        <h2>
            创建微应用
        </h2>
        <div>
            @using (Html.BeginForm("CreateMicroapplication", "home", FormMethod.Post, new { target = "ajaxframe", ID = "fromCreateMicroapplication" }))
            {
                <div>
                    <p>
                        <span>appIcon</span>@Html.TextBox("appIcon", "@lADPBY0V4sFt3jPMr8yv")
                    </p>
                    <p>
                        <span>appName</span>@Html.TextBox("appName", "小号")
                    </p>
                    <p>
                        <span>appDesc</span>@Html.TextBox("appDesc", "小号测试")
                    </p>
                    <p>
                        <span>homepageUrl</span>@Html.TextBox("homepageUrl", "http://oa.dingtalk.com/?h5")
                    </p>
                    <input type="button" value="创建微应用" onclick="getCreateMicroapplication()" />
                </div>
            }
            <div id="getCreateMicroapplications">
            </div>
            <script>
                function getCreateMicroapplication() {
                    $.post("/home/CreateMicroapplication?time=" + new Date().getTime(), $("#fromCreateMicroapplication").serializeArray(), function (msg) {
                        $("#getCreateMicroapplications").html(msg);
                    })
                }
            </script>
        </div>
    </div>

    <div class="item">
        <h2>
            更新微应用
        </h2>
        <div>
            @using (Html.BeginForm("UpdateMicroapplication", "home", FormMethod.Post, new { target = "ajaxframe", ID = "fromUpdateMicroapplication" }))
            {
                <div>
                    <p>
                        <span>appIcon</span>@Html.TextBox("appIcon", "@lADPBY0V4sFt3jPMr8yv")
                    </p>
                    <p>
                        <span>agentId</span>@Html.TextBox("agentId", 152866695)
                    </p>
                    <p>
                        <span>appName</span>@Html.TextBox("appName", "小号12")
                    </p>
                    <p>
                        <span>appDesc</span>@Html.TextBox("appDesc", "向荣测试")
                    </p>
                    <p>
                        <span>homepageUrl</span>@Html.TextBox("homepageUrl", "http://oa.dingtalk.com/?h5")
                    </p>
                    <input type="button" value="更新微应用" onclick="getUpdateMicroapplication()" />
                </div>
            }
            <div id="getUpdateMicroapplications">
            </div>
            <script>
                function getUpdateMicroapplication() {
                    $.post("/home/UpdateMicroapplication?time=" + new Date().getTime(), $("#fromUpdateMicroapplication").serializeArray(), function (msg) {
                        $("#getUpdateMicroapplications").html(msg);
                    })
                }
            </script>
        </div>
    </div>

    <div class="item">
        <h2>
            删除微应用
        </h2>
        <div>
            @using (Html.BeginForm("DeleteMicroapplication", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>agentId</span>@Html.TextBox("agentId", 111)
                    </p>
                    <input type="submit" value="删除微应用" />
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            列出微应用
        </h2>
        <div>
            @using (Html.BeginForm("MicroapplicationList", "home", FormMethod.Post, new { target = "ajaxframe", ID = "fromMicroapplicationList" }))
            {
                <div>
                    <p>
                        <span>agentId</span>@Html.TextBox("agentId", 116862417)
                    </p>
                    <input type="button" value="列出微应用" onclick="getMicroapplicationList()" />
                </div>
            }
            <div id="getMicroapplicationLists">
            </div>
            <script>
                function getMicroapplicationList() {
                    $.post("/home/MicroapplicationList?time=" + new Date().getTime(), $("#fromMicroapplicationList").serializeArray(), function (msg) {
                        $("#getMicroapplicationLists").html(msg);
                    })
                }
            </script>
        </div>
    </div>

    <div class="item">
        <h2>
            获取企业设置的微应用可见范围
        </h2>
        <div>
            @using (Html.BeginForm("ObtainMicroapplicationVisible", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>agentId</span>@Html.TextBox("agentId", 116862417)
                    </p>
                    <input type="button" value="获取企业设置的微应用可见范围" onclick="getObtainMicroapplicationVisible()" />
                </div>
            }
            <div id="getObtainMicroapplicationVisibles">
            </div>
            <script>
                function getObtainMicroapplicationVisible() {
                    $.post("/home/ObtainMicroapplicationVisible?time=" + new Date().getTime(), $("#agentId").serializeArray(), function (msg) {
                        $("#getObtainMicroapplicationVisibles").html(msg);
                    })
                }
            </script>
        </div>
    </div>

    <div class="item">
        <h2>
            设置微应用的可见范围
        </h2>
        <div>
            @using (Html.BeginForm("Setmicroapplicationvisible", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>agentId</span>@Html.TextBox("agentId", 152866695)
                    </p>
                    <p>
                        <span>isHidden</span>@Html.TextBox("isHidden", false)
                    </p>
                    <p>
                        <span>deptVisibleScopes</span>@Html.TextBox("deptVisibleScopes", 18296475)
                    </p>
                    <p>
                        <span>userVisibleScopes</span>@Html.TextBox("userVisibleScopes", "manager5443")
                    </p>
                    <input type="submit" value="设置微应用的可见范围"/>
                </div>
            }
        </div>
    </div>

    <div class="item">
        <h2>
            获取指定微应用下指定用户绑定的全部规则
        </h2>
        <div>
            @using (Html.BeginForm("GetAllRules", "home", FormMethod.Post, new { target = "ajaxframe", ID = "fromGetAllRules" }))
            {
                <div>
                    <p>
                        <span>userid</span>@Html.TextBox("userid", "manager5443")
                    </p>
                    <p>
                        <span>agentId</span>@Html.TextBox("agentId", "116862417")
                    </p>
                    <input type="button" value="获取指定微应用下指定用户绑定的全部规则" onclick="getGetAllRules()" />
                </div>
            }
            <div id="getGetAllRuless">
            </div>
            <script>
                function getGetAllRules() {
                    $.post("/home/GetAllRules?time=" + new Date().getTime(), $("#fromGetAllRules").serializeArray(), function (msg) {
                        $("#getGetAllRuless").html(msg);
                    })
                }
            </script>
        </div>
    </div>

    <div class="item">
        <h2>
            获取规则绑定的用户数
        </h2>
        <div>
            @using (Html.BeginForm("Getrulesusercount", "home", FormMethod.Post, new { target = "ajaxframe", ID = "fromGetrulesusercount" }))
            {
                <div>
                    <p>
                        <span>agentId</span>@Html.TextBox("agentId", 116862417)
                    </p>
                    <p>
                        <span>agenruleIdListtId</span>@Html.TextBox("ruleIdList", 116862417)
                    </p>
                    <input type="button" value="获取规则绑定的用户数" onclick="getGetrulesusercount()" />
                </div>
            }
            <div id="getGetrulesusercounts">
            </div>
            <script>
                function getGetrulesusercount() {
                    $.post("/home/Getrulesusercount?time=" + new Date().getTime(), $("#fromGetrulesusercount").serializeArray(), function (msg) {
                        $("#getGetrulesusercounts").html(msg);
                    })
                }
            </script>
        </div>
    </div>

    <div class="item">
        <h2>
            删除规则
        </h2>
        <div>
            @using (Html.BeginForm("Deleterules", "home", FormMethod.Post, new { target = "ajaxframe" }))
            {
                <div>
                    <p>
                        <span>agentId</span>@Html.TextBox("agentId", 152866695)
                    </p>
                    <p>
                        <span>ruleId</span>@Html.TextBox("ruleId", 1231)
                    </p>
                    <input type="submit" value="Deleterules" />
                </div>
            }
        </div>
    </div>


</fieldset>



